home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 1.7 KB | 74 lines | [TEXT/ToyS] |
- property kasClippedPictType : "clpp"
- property kasClippingCreator : "drag"
- property kasPictureType : "PICT"
-
-
- on open fsObjs
- repeat with fsObj in fsObjs
- DoOne(fsObj)
- end repeat
- end open
-
-
- on DoOne(fsObj)
- set fInfo to basic info for fsObj
-
- -- Got a picture clipping file?
- if (system type of fInfo is kasClippedPictType) and ¬
- (system creator of fInfo is kasClippingCreator) then
-
- -- Load the picture
- set myPict to the clipping from fsObj ¬
- only returning the picture
-
- -- Add it to the clipboard
- clip myPict
-
- -- Get its info
- set pinfo to the picture info for myPict
-
- -- Expand for info at bottom
- set wBox to picture bounds of pinfo
- set textTop to item 4 of wBox
- set textMid to ((item 3 of wBox) - (item 1 of wBox)) / 2
- set item 4 of wBox to textTop + 64
-
- -- Create display window
- set pWindow to ¬
- display drawing titled (catalog name of fInfo) ¬
- with dimensions {(item 3 of wBox) - (item 1 of wBox), (item 4 of wBox) - (item 1 of wBox)}
-
- -- Draw the picture
- draw a picture into pWindow ¬
- using data myPict
-
- -- Show the name
- draw a string into pWindow ¬
- offset by {textMid, textTop + 16} ¬
- using data "File: " & (fsObj as string)
-
- -- Show the size
- draw a string into pWindow ¬
- offset by {textMid, textTop + 32} ¬
- using data "Size: " & (picture size of pinfo)
-
- -- Show the dimensions
- draw a string into pWindow ¬
- offset by {textMid, textTop + 48} ¬
- using data "Dims: " & DimsText(picture bounds of pinfo)
-
- -- Pause, then close
- pause for 5 with seconds timing
- display drawing pWindow with disposal
- else
- beep
- end if
- end DoOne
-
-
- on DimsText(box)
- set w to (item 3 of box) - (item 1 of box)
- set h to (item 4 of box) - (item 2 of box)
- return w & " x " & h
- end DimsText
-